//
//  StoreViewCell.m
//  欢乐美食
//
//  Created by 遇水 on 15/6/17.
//  Copyright (c) 2015年 遇水. All rights reserved.
//

#import "StoreViewCell.h"
#import "UIImageView+WebCache.h"

#import "MSDeals.h"

@interface StoreViewCell()

/**头像*/
@property (weak, nonatomic) IBOutlet UIImageView *dealImage;    //头像
/**团购名称*/
@property (weak, nonatomic) IBOutlet UILabel *dealName;    //店铺名称
/**地址*/
@property (weak, nonatomic) IBOutlet UILabel *address;    //地址
/**已买人数*/
@property (weak, nonatomic) IBOutlet UILabel *renshu;   //
/**现价*/
@property (weak, nonatomic) IBOutlet UILabel *range;     //距离
/**原价*/
@property (weak, nonatomic) IBOutlet UILabel *zhekou;    //现价

@end
@implementation StoreViewCell

- (void)awakeFromNib {
    // Initialization code
}


-(void)setDeal:(MSDeals *)deal
{
    _deal = deal;
    //图片
    [self.dealImage setImageWithURL:[NSURL URLWithString:deal.s_image_url]];
    self.dealName.text = deal.title;
    self.address.text = deal.regions[0];
    
    self.renshu.text = [NSString stringWithFormat:@"已售:%@",deal.purchase_count];
    //原价
    NSString *price = [NSString stringWithFormat:@"￥%@",deal.list_price];
//    [self.range setTitle:price  forState:UIControlStateNormal];
    self.range.text = price;
    //现价
    self.zhekou.text = [NSString stringWithFormat:@"￥%@",deal.current_price];

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
//-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
//{
//    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
//    
//}

//-(void)layoutSubviews{
//    [super layoutSubviews];
////    self.userImage.layer.cornerRadius = 5;
//    [self.range setImage:[UIImage imageNamed:@"location"] forState:UIControlStateNormal];
//
//}


@end
